﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Red.GameData.Raw
{
    public partial class DataObject
    {
        /// <summary>
        /// Remove property override, all inherited values are removed
        /// This will remove a property EVEN if it has suppress value overrides
        /// </summary>
        public bool Action_RemovePropertyOverride(string propertyName)
        {
            // lame linear search
            foreach (var prop in _properties)
            {
                if (prop.Name == propertyName)
                {
                    prop.MarkModified();
                    _properties.Remove(prop);
                    MarkModified();
                    return true;
                }
            }

            // property not found
            return false;
        }
    }
}
